package com.headingsoft.jxc.web;

import java.util.List;

import org.springframework.roo.addon.web.mvc.controller.RooWebScaffold;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import com.headingsoft.jxc.domain.GoodsCategory;

@RooWebScaffold(path = "goodscategorys", formBackingObject = GoodsCategory.class)
@RequestMapping("/goodscategorys")
@Controller
public class GoodsCategoryController {

    @RequestMapping(params = "find=ByParent", method = RequestMethod.GET)
    public String findGoodsCategorysByParent(Model uiModel) {
    	List<GoodsCategory> gcs = GoodsCategory.findAllTopGoodsCategory();
    	
        uiModel.addAttribute("goodscategorys", gcs);
        return "goodscategorys/findGoodsCategorysByParentList";
    }
}
